package jzOffer;

import java.util.Stack;

class MinStack {
    Stack<Integer> s1=new Stack<>();
    Stack<Integer> s2=new Stack<>();
    /** initialize your data structure here. */
    public MinStack() {
    }

    public void push(int x) {
        s1.push(x);
        if(s2.isEmpty()){
            s2.push(x);
        }else {
            int val = s2.peek();
            s2.push(Math.min(val, x));
        }
    }

    public void pop() {
        s1.pop();
        s2.pop();
    }

    public int top() {
        return s1.peek();
    }

    public int min() {
        return s2.peek();
    }
}

public class Num30 {

}
